package com.feeyo.lib_baidutts.voice

/**
 *作者：QLH on 2023-03-20
 *描述：
 */
enum class VoiceResourceType(val type: VoiceStatus) {
    NEW_TASK(VoiceStatus(PushType.TASK_NEW, "receive_task.pcm")),//收到新任务
    CANCEL_TASK(VoiceStatus(PushType.TASK_CANCEL, "cancel_task.pcm")),//取消任务
    TRANSFER_TASK(VoiceStatus(PushType.TASK_TRANSFER, "transfer_task.pcm")),//任务转派
    ACCEPT_TASK(VoiceStatus(PushType.ACCEPT_TASK, "accept_task.pcm")),//接受任务
    COMPLETE_TASK(VoiceStatus(PushType.COMPLETE_TASK, "complete_task.pcm")),//完成任务
    START_TASK(VoiceStatus(PushType.START_TASK, "start_task.pcm")),//开始任务
    FAIL_OPT_TASK(VoiceStatus(PushType.FAIL_OPT, "fail_opt_task.pcm"));//操作失败

    companion object {
        fun getName(type: String): String? {
            values().forEach {
                if (it.type.type == type)
                    return it.type.name
            }
            return null
        }
    }

}

data class VoiceStatus(
    val type: String,//参考推送的消息的type：PushType
    val name: String
)

internal object PushType {
    val TASK_NEW = "taskNew"//您有一个新任务
    val TASK_CANCEL = "taskResourceRemove"//任务已取消
    val TASK_TRANSFER = "taskTransfer"//任务转派
    val ACCEPT_TASK = "acceptTask"//接受任务
    val START_TASK = "startTask"//开始任务
    val COMPLETE_TASK = "completeTask"//完成任务
    val FAIL_OPT = "optFail"//操作失败
}